package sfmc.biz.comm;

import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

import sfmc.biz.vo.Sfmc_TB_EMPLOYEE;

public class SfmcRegValidator implements Validator{
	
	@Override
	public boolean supports(Class<?> clazz) {
		
		return Sfmc_TB_EMPLOYEE.class.isAssignableFrom(clazz);
	}

	@Override
	public void validate(Object target, Errors errors) {
				
		Sfmc_TB_EMPLOYEE sfmc_TB_EMPLOYEE = (Sfmc_TB_EMPLOYEE)target;
		if(sfmc_TB_EMPLOYEE.getEmpName() == null || sfmc_TB_EMPLOYEE.getEmpName().trim().equals("")){
			errors.rejectValue("EmpName", "requared");
		}
	}
}
